import Layout from "@/pages/Layout"
// import Month from "@/pages/Month"
// import New from "@/pages/New"
// import Year from "@/pages/Year"
import { lazy, Suspense } from "react"
import { createBrowserRouter } from "react-router-dom"

const Month = lazy(() => import('@/pages/Month'))
const New = lazy(() => import('@/pages/New'))
const Year = lazy(() => import('@/pages/Year'))

const router = createBrowserRouter([
  {
    path: '/',
    element: <Layout />,
    children: [
      {
        // path: '/',
        index: true,
        element: <Suspense fallback={'加载中。。。'}><Month /></Suspense>
      },
      {
        path: '/year',
        element: <Suspense fallback={'加载中。。。'}><Year /></Suspense>
      }
    ]
  },
  {
    path: '/new',
    element: <Suspense fallback={'加载中。。。'}><New /></Suspense>
  }
])

export default router